package org.mat.ipaas.ucenter.service.api.system;

import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.mat.framework.lang.dto.MatApiResponse;
import org.mat.ipaas.ucenter.service.dto.system.entity.SysCommentDTO;
import org.mat.ipaas.ucenter.service.dto.system.vo.SysCommentFileVoDTO;
import org.mat.ipaas.ucenter.service.dto.system.vo.SysCommentVODTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 系统评论回复表
 */
@Api(tags = "系统评论回复表")
@FeignClient(name = "mat-ipaas-ucenter-service",contextId = "sys-comment-rest-api")
public interface SysCommentRestAPI {

    /**
     * 查询评论+文件
     *
     * @param sysCommentDTO
     * @return
     */
    @ApiOperation(value = "系统评论回复表-列表查询", notes = "系统评论回复表-列表查询")
    @GetMapping(value = "/sys/comment/listByForm")
    MatApiResponse<IPage<SysCommentVODTO>> queryListByForm(SysCommentDTO sysCommentDTO);

    /**
     * 查询文件
     *
     * @param sysCommentDTO
     * @return
     */
    @ApiOperation(value = "系统评论回复表-列表查询", notes = "系统评论回复表-列表查询")
    @GetMapping(value = "/sys/comment/fileList")
    MatApiResponse<IPage<SysCommentFileVoDTO>> queryFileList(SysCommentDTO sysCommentDTO);

    @ApiOperation(value = "系统评论表-添加文本", notes = "系统评论表-添加文本")
    @PostMapping(value = "/sys/comment/addText")
    MatApiResponse<String> addText(@RequestBody SysCommentDTO sysCommentDTO);

    @ApiOperation(value = "系统评论表-添加文件", notes = "系统评论表-添加文件")
    @PostMapping(value = "/sys/comment/addFile")
    MatApiResponse<String> addFile(@RequestParam HttpServletRequest request);

    @ApiOperation(value = "系统评论回复表-通过id删除", notes = "系统评论回复表-通过id删除")
    @DeleteMapping(value = "/sys/comment/deleteOne")
    MatApiResponse<String> deleteOne(@RequestParam(name = "id", required = true) String id);


    /**
     * 获取文件预览的地址
     * @return
     */
    @GetMapping(value = "/sys/comment/getFileViewDomain")
    MatApiResponse<String> getFileViewDomain();


    /**
     * 分页列表查询
     *
     * @param sysCommentDTO
     * @param pageNo
     * @param pageSize
     * @param req
     * @return
     */
    //@AutoLog(value = "系统评论回复表-分页列表查询")
    @ApiOperation(value = "系统评论回复表-分页列表查询", notes = "系统评论回复表-分页列表查询")
    @GetMapping(value = "/sys/comment/list")
    MatApiResponse<IPage<SysCommentDTO>> queryPageList(SysCommentDTO sysCommentDTO,
                                                       @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                       @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                       @RequestParam HttpServletRequest req);


    /**
     * 添加
     *
     * @param sysCommentDTO
     * @return
     */
    @ApiOperation(value = "系统评论回复表-添加", notes = "系统评论回复表-添加")
    //@RequiresPermissions("org.mat.ipaas.sys.biz.modules.demo:sys_comment:add")
    @PostMapping(value = "/sys/comment/add")
    MatApiResponse<String> add(@RequestBody SysCommentDTO sysCommentDTO);

    /**
     * 编辑
     *
     * @param sysCommentDTO
     * @return
     */
    //@AutoLog(value = "系统评论回复表-编辑")
    @ApiOperation(value = "系统评论回复表-编辑", notes = "系统评论回复表-编辑")
    //@RequiresPermissions("org.mat.ipaas.sys.biz.modules.demo:sys_comment:edit")
    @RequestMapping(value = "/sys/comment/edit", method = {RequestMethod.POST})
    MatApiResponse<String> edit(@RequestBody SysCommentDTO sysCommentDTO);

    /**
     * 通过id删除
     *
     * @param id
     * @return
     */
    //@AutoLog(value = "系统评论回复表-通过id删除")
    @ApiOperation(value = "系统评论回复表-通过id删除", notes = "系统评论回复表-通过id删除")
    //@RequiresPermissions("org.mat.ipaas.sys.biz.modules.demo:sys_comment:delete")
    @DeleteMapping(value = "/sys/comment/delete")
    MatApiResponse<String> delete(@RequestParam(name = "id", required = true) String id);

    /**
     * 批量删除
     *
     * @param ids
     * @return
     */
    //@AutoLog(value = "系统评论回复表-批量删除")
    @ApiOperation(value = "系统评论回复表-批量删除", notes = "系统评论回复表-批量删除")
    //@RequiresPermissions("org.mat.ipaas.sys.biz.modules.demo:sys_comment:deleteBatch")
    @DeleteMapping(value = "/sys/comment/deleteBatch")
    MatApiResponse<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids);

    /**
     * 通过id查询
     *
     * @param id
     * @return
     */
    //@AutoLog(value = "系统评论回复表-通过id查询")
    @ApiOperation(value = "系统评论回复表-通过id查询", notes = "系统评论回复表-通过id查询")
    @GetMapping(value = "/sys/comment/queryById")
    MatApiResponse<SysCommentDTO> queryById(@RequestParam(name = "id", required = true) String id);

    /**
     * 导出excel
     *
     * 
     * @param sysCommentDTO
     */
    //@RequiresPermissions("org.mat.ipaas.sys.biz.modules.demo:sys_comment:exportXls")
    @RequestMapping(value = "/sys/comment/exportXls")
    ModelAndView exportXls( SysCommentDTO sysCommentDTO);

    /**
     * 通过excel导入数据
     *
     * 
     * 
     * @return
     */
    //@RequiresPermissions("sys_comment:importExcel")
    @RequestMapping(value = "/sys/comment/importExcel", method = RequestMethod.POST)
    MatApiResponse<?> importExcel( );


}
